import Demo01Context from './Demo01Context';
import { useContext } from 'react'; 

//子组件-1
const ChildA1 = () => {
	const { count1, setCount1, count2, setCount2 } = useContext(Demo01Context);
	return <div className="note-demo-child-box">
		<div>ChildA1</div>
		<button onClick={() => {setCount1(count1 + 1)}}>count1:{count1}</button>
		<button onClick={() => {setCount2(count2 - 1)}}>count2:{count2}</button>
	</div>
}

export default ChildA1;
